<div class="row-fluid"> 
    <div class="box span12">
        <div class="box-header" data-original-title>
            <h2>
                Customer Information
            </h2>            
        </div>
        <!--Thông tin cho Order đã Completed-->
        <?php if (isset($receipt)): ?>
            <div class="box-content" >
                <div class="row-fluid">
                    <div class="span4">
                        <p class="success f-weight">
                            <a target="_blank" href="<?php echo $receipt->order->customer->viewUrl ?>">
                                <?php echo $receipt->order->customer->user->name; ?>
                            </a>
                        </p>
                        <p>
                            <?php echo $receipt->order->customer->user->phone; ?>
                        </p>
                        <p>
                            <a target="_blank" href="<?php echo $receipt->order->customer->viewUrl ?>">
                                <?php echo $receipt->order->customer->user->email; ?>
                            </a>
                        </p>
                    </div>
                    <div class="span4">
                        <table>
                            <tr>
                                <td class="name-item">Order #:</td>
                                <td>
                                    <?php echo $receipt->order->order_key ?>
                                </td>
                            <tr>
                                <td class="name-item">Closed:</td>
                                <td>
                                    <?php echo $receipt->order->formartDate() ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="name-item">List price:</td>
                                <td>
                                    $<?php echo $receipt->list_price ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="name-item">Amount Paid:</td>
                                <td>
                                    $<?php echo $receipt->order->payment->amount ?>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>

                <hr>
                <div class="box-btn">
                    <!--                <a class="btn btn-success" href="#" onclick="alert('Coming Soon !');">
                                        Book Again
                                    </a>-->
                    <a class="btn btn-info" href="<?php echo Yii::app()->createUrl("order/sendEmail", array('pk' => $receipt->order->order_key)); ?>">
                        Email Receipt
                    </a>
                    <a class="btn btn-danger" id="btnprint"href="#">
                        Print Receipt
                    </a>

                    <script>
                        $('#btnprint').click(function() {
                            printDiv('receipt');
                        });
                    </script>
                    <script src="<?php echo $this->assetDirWeb ?>js/Webmaster/custom.js"></script>
                    <script src="<?php echo $this->assetDirWeb ?>js/Webmaster/jquery.print.js"></script>
                </div>
                <div class="clear"></div>
            </div>
            <!--Order Pending/Confirmed-->
        <?php elseif (isset($order)): ?>
            <div class="box-content" >
                <div class="row-fluid">
                    <div class="span4">
                        <p class="success f-weight">
                            <a target="_blank" href="<?php echo $order->customer->viewUrl ?>">
                                <?php echo $order->customer->user->getName(); ?>
                            </a>
                        </p>
                        <p>
                            <?php echo $order->customer->user->phone; ?>
                        </p>
                        <p>
                            <a target="_blank" href="<?php echo $order->customer->viewUrl ?>">
                                <?php echo $order->customer->user->email; ?>
                            </a>
                        </p>
                        <a title="Cancel Order" href="<?php echo Yii::app()->createUrl('order/changeStt', array('pk' => $order->order_key)) ?>" 
                           class="btn btn-danger" id="btn-check-out"><i class="icon-remove"></i>&nbsp;Cancel Order</a>
                    </div>
                    <div class="span4">
                        <table>
                            <tr>
                                <td class="name-item">Order #:</td>
                                <td>
                                    <?php echo $order->order_key ?>
                                </td>
                            <tr>
                                <td class="name-item">Closed:</td>
                                <td>
                                    <?php echo $order->formartDate() ?>
                                </td>
                            </tr>
                            <tr>
                                <td class="name-item">Price:</td>
                                <td>
                                    $<?php echo $order->s_price ?>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <hr>
            </div>
        <?php endif; ?>
    </div>
</div>
